Lossless bi-directional formatting of program source code

ABSTRACT

A method, computer program product, and system includes a processor(s) of a host obtaining, from a client, via a communication connection over a network, a request to commit a modified version of program source code to a repository administered by the host. The processor(s) identify formatting in the modified version implemented by an editor executing on the client and remove the formatting. The processor(s) transform the modified version into a first storage structure that includes content of the modified version without the identified formatting. The processor(s) identify one or more differences between the first storage structure representing the modified version and a second storage structure (an unmodified version of the program source code stored in the repository). The processor(s) store the one or more differences in the repository.

BACKGROUND

The invention relates to bi-directional formatting of program sourcecode for development, debugging and executing in computing environments.The perceived proper style and formatting of program source code is asubject of debate among software developers. Traditionally the intentionof laying code out in a particular style has been to maximizereadability, allowing the logic, content, and progression of the code tobe quickly understood by a developer reviewing the text. Unfortunately,what constitutes readability can be a subjective measure.Inconsistencies in formatting, as implemented in accordance with variousdevelopers collaborating on one or more programs, potentially mask thediscovery of real logic problems in the code.

SUMMARY

Shortcomings of the prior art are overcome and additional advantages areprovided through the provision of a method for implementingbi-directional source code format control. The method includes, forinstance: obtaining, by one or more processors of a host, from a client,via a communication connection over a network, a request to commit amodified version of program source code to a repository administered bythe host; identifying, by the one or more processors, formatting in themodified version implemented by an editor executing on the client;removing, by the one or more processors, the identified formatting fromthe modified version; transforming, by the one or more processors, themodified version into a first storage structure comprising content ofthe modified version without the identified formatting; identifying, bythe one or more processors, one or more differences between the firststorage structure representing the modified version and a second storagestructure, wherein the second storage structure comprises an unmodifiedversion of the program source code stored in the repository; andstoring, by the one or more processors, the one or more differences inthe repository.

Shortcomings of the prior art are overcome and additional advantages areprovided through the provision of a computer program product forimplementing bi-directional source code format control. The computerprogram product comprises a storage medium readable by a processingcircuit and storing instructions for execution by the processing circuitfor performing a method. The method includes, for instance: obtaining,by the one or more processors of a host, from a client, via acommunication connection over a network, a request to commit a modifiedversion of program source code to a repository administered by the host;identifying, by the one or more processors, formatting in the modifiedversion implemented by an editor executing on the client; removing, bythe one or more processors, the identified formatting from the modifiedversion; transforming, by the one or more processors, the modifiedversion into a first storage structure comprising content of themodified version without the identified formatting; identifying, by theone or more processors, one or more differences between the firststorage structure representing the modified version and a second storagestructure, wherein the second storage structure comprises an unmodifiedversion of the program source code stored in the repository; andstoring, by the one or more processors, the one or more differences inthe repository.

Methods and systems relating to one or more aspects are also describedand claimed herein. Further, services relating to one or more aspectsare also described and may be claimed herein.

Additional features are realized through the techniques describedherein. Other embodiments and aspects are described in detail herein andare considered a part of the claimed aspects.

BRIEF DESCRIPTION OF THE DRAWINGS

One or more aspects are particularly pointed out and distinctly claimedas examples in the claims at the conclusion of the specification. Theforegoing and objects, features, and advantages of one or more aspectsare apparent from the following detailed description taken inconjunction with the accompanying drawings in which:

FIG. 1 is a workflow illustrating certain aspects of an embodiment ofthe present invention;

FIG. 2 is an illustration of a technical environment into which variousaspects of an embodiment of the present invention may be implemented;

FIG. 3 is a workflow illustrating certain aspects of an embodiment ofthe present invention;

FIG. 4 is a workflow illustrating certain aspects of an embodiment ofthe present invention;

FIG. 5 depicts one embodiment of a computing node that can be utilizedin a cloud computing environment;

FIG. 6 depicts a cloud computing environment according to an embodimentof the present invention; and

FIG. 7 depicts abstraction model layers according to an embodiment ofthe present invention.

DETAILED DESCRIPTION

The accompanying figures, in which like reference numerals refer toidentical or functionally similar elements throughout the separate viewsand which are incorporated in and form a part of the specification,further illustrate the present invention and, together with the detaileddescription of the invention, serve to explain the principles of thepresent invention. As understood by one of skill in the art, theaccompanying figures are provided for ease of understanding andillustrate aspects of certain embodiments of the present invention. Theinvention is not limited to the embodiments depicted in the figures.

As understood by one of skill in the art, program code, as referred tothroughout this application, includes both software and hardware. Forexample, program code in certain embodiments of the present inventionincludes fixed function hardware, while other embodiments utilized asoftware-based implementation of the functionality described. Certainembodiments combine both types of program code. One example of programcode, also referred to as one or more programs, is depicted in FIG. 5 asprogram/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28.

In embodiments of the present invention, a computer-implemented method,a computer program product, and a computer system include program codethat provides lossless bi-directional formatting of program source code.Embodiments of the present invention provide advantages over existingsource code formatting techniques at least because in these embodiments,one or more programs executing on at least one processing circuitprovide bi-directional translation, at the server side, on the programsource code, automatically, i.e., without user intervention. Utilizingan embodiment of the present invention, a software developer working ona client in an editor can set up individual editor and formattersettings, and despite this customization, the one or more programsautomatically format the source code to a standard style on sourceextract. When a developer working on the client checks in changes, theone or more programs translate the program source code back to astructure supported by the server, to compare the updated code to theprevious version in the repository, and to calculate the real changesmade.

Advantages of some embodiments of the present invention over existingsource code formatting systems, include, but are not limited to: 1)embodiments of the present invention enable individual developers tointeract with source code in an editor using customized visual settings;2) embodiments of the present invention avoid the need for developersworking jointing to agree on a coding standard up-front, which can be aprolonged and inefficient negotiation; 3) embodiments of the presentinvention similarly avoid the need for any agreement between developersregarding the styling and the formatting of the source code at codereview; and 4) embodiments of the present invention eliminate the needfor an individual to have to use different styles for differentprojects/teams that this individual works on concurrently, in which thestandardization of the program code may vary.

Aspects of the present invention address inefficiencies in codedevelopment by implementing server-side commercial source control ofsoftware. The automatic bi-directional formatting of source code inembodiments of the present invention is inextricably tied to computingbecause these one or more programs, which execute on at least oneprocessor (of one or more servers) in a multi-user computingenvironment, address development and version control inefficiencies.Certain aspects of embodiments of the present invention can beintegrated with existing solutions to provide enterprise systems withthe added functionality described herein. For example, aspects ofcertain embodiments of the present invention can be integrated intoexisting commercial source control software, including but not limitedto, IBM® Rational® Team Concert™, a proprietary Git (a version controlsystem) extension for the Jazz Hub cloud hosted source control, a freeoffering (e.g., Eclipse), and/or other editor plugins that depend upon aproprietary backend. IBM® and Rational® are registered trademarks ofInternational Business Machines Corporation, Armonk, N.Y., US. IBM®Rational® Team Concert™ is a software development team collaborationtool. Presently, IBM® Rational® Team Concert™ and Git integration can beutilized to manage process enforcement for Git source control operationsand to associate work items with Git commits. Git is compatible withvarious operating systems and Integrated Development Environments(IDEs), and when integrated with aspects of embodiments of the presentinvention, Git can maintain this portability. However, aspects ofvarious embodiments of the present invention can be integrated withsource control systems, Git is one example that is offered here forillustrative purposes.

Aspects of various embodiments of the present invention improveproductivity of a developer workforce because style, formatting andinterpretation of source code is an everyday problem faced bycollaborating developers and introduces inconsistencies andinefficiencies into the process, which are decreased, if not eliminated,though the implementation of aspects of embodiments of the presentinvention. Existing automatic formatting systems for source code forcedevelopers to adopt a common style, enforced by company-wide orproject-specific standards. These systems prevent each individual fromworking in a style that this individual feels most comfortable with andthe style that this individual is most productive when reading andwriting source code utilizing. In contrast, in embodiments of thepresent invention, while a client program executing on a developer'scomputing node enables the developer to customize her or his editor(e.g., setting up editor and formatter settings), one or more programsof this client application automatically format the code on sourceextract. Thus, when the edits to the source made by the developer resultin changes, to deliver these changes to a repository on or accessible toa server, the one or more programs translate the source code back to astructure supported by the server, compare the source to a previousversion in the repository, and calculate the real changes made. Hence,in embodiments of the present invention, one or more programs providebi-directional translation, server side, on program source code, withoutuser intervention.

Embodiments of the present invention provide various advantages overexisting automatic formatting systems for source code. For example, inembodiments of the present invention, one or more programs provide theaforementioned lossless bi-directional formatting and store the sourcecode remotely, such that multiple developers can employ their ownindividual styles choices regardless of how the source code is stored.This one or more programs are compatible with any editor and aretransparent, from the point of view of the user. In addition, inembodiments of the present invention, the one or more programs store theprogram source code with no format in a repository. The lossless qualityof the automatic formatting in embodiments of the present invention isadvantageous over client-side automatic formatting systems for sourcecode, which are not lossless. In client-side systems, whitespace andformatting are re-applied atop a user's local changes, which can resultin losses, but in embodiments of the present invention, the one or moreprograms losslessly strip these items server side.

FIG. 1 is a workflow that depicts aspects of some embodiments of thepresent invention. FIG. 1 depicts certain aspects that occur (or areexperienced) on a client side 111 (e.g., on a computing devicecommunicatively coupled to a server) and certain aspects that occur on aserver side 121. As mentioned above, by handling certain aspects serverside, as opposed to client-side, one or more programs in embodiments ofthe present invention provide lossless bi-directional formatting.

In some embodiments of the present invention, one or more programsexecuting on a processing resource on the server side 121, execute aneditor client application (or provide an editor client application as aservice) to a computing node on the client side 111. In anotherembodiment of the present invention, the one or more programs receiveindications from an editor executing on the client-side to indicateactions taken by users of a client application, on a computing noderemote, from the one or more server on the server side 121.

In some embodiments of the present invention, program code executing ona resource on the server side 121 in a multi-user computing environment,obtains an indication that a user of a program source code editor on theclient side 111 has committed and/or checked in changes to the programsource code (110). Upon obtaining this indication, the one or moreprograms determine if there is local formatting in the program sourcecode (120). Local formatting refers to customizations made by the userwhile working with the program source code in the editor. For example,the user may have selected specific formatting to view when working onthe program source code. As mentioned earlier, aspects of embodiments ofthe present invention, because they execute at the server side 121, canbe utilized across editors and are transparent, from the point of viewof the user. If there is no local formatting, the one or more programsidentify any default formatting utilized in the editor to format theprogram source code (125). The one or more programs remove theformatting, whether custom or default, from the program source code(130). Once the formatting has been removed, on the server side 121, theone or more programs transform the program source code into a structurethat will be stored in a code repository (140). The one or more programsutilize a last version (or last storage structure) of a relevant portionof the program source code to compare this last version to thetransformed program source code and identify changes between thetransformed program source code and the last version (150). The one ormore programs store the changes in the repository with the storagestructure (160).

FIG. 2 is a technical environment 200 into which aspects of the presentinvention can be implemented. The technical environment includes acomputing node 201 upon which an editing program (editor) 202 isaccessible to a user/developer. The computing node 201 and the editingprogram 202 communicate with one or more servers 203 executing one ormore programs executing aspects of the embodiments of the presentinvention. The computing node 201 and the server(s) 203 communicate overa network, including but not limited to, the Internet 205. The one ormore servers 203 include and/or are communicatively coupled with arepository 204, utilized to store program source code and ensure versioncontrol and integrity.

FIG. 3 is an expanded workflow 300 of certain aspects of embodiments ofthe present invention that further explains the interaction of a userwith one or more programs in some embodiments of the present inventionand the benefits to the user of the lossless bi-directional formattingof the program source code by the one or more programs. To aid inillustrating this workflow 300, references are made to the technicalenvironment 200 of FIG. 2. These references are not meant to imply thatthis workflow 300 is limited to implementation in environments thatresemble the technical environment 200 of FIG. 2, but are merelyincluded for illustrative purposes.

As illustrated in the workflow 300, in embodiments of the presentinvention, a developer (user) configures settings in the editor 202 tocreate a visual of the program source code (e.g., structure, formatting,and style) in the graphical user interface of the computing node 201such that the program source code is displayed to the developer in amanner that is visually desirable to the user (310). While editing theprogram source code in the editor 201, the developer implements at leastone change to the program source code by working through the configurededitor (320). The developer checks in or commits the modified programsource code to a repository 204 (the modified program source code is theprogram source code that includes the at least one change) (330). Duringthe editing, certain changes that are made by the developer to the codemay be formatting rather than substantive changes. For example, adeveloper may insert whitespace into program source code.

One or more programs executing on a processing resource of a server 203(or one or more server) obtain the modified program source code, removeformatting, and translate the modified program source code into a setstructure representing the modified program source code (340). The setstructure may vary across different implementations of aspects ofembodiments of the present invention and may include, but is not limitedto, a tree structure. The set structure may be selected based onattributes of the program source code, including but not limited to, theprogramming language utilized. For example, depending upon theprogramming language, the one or more programs may handle whitespace inthe program source code differently. Whitespace is not significant incertain languages, including but not limited to Java, C, and mostpopular languages, with the exclusion of certain popular languages suchas python and haskell. Thus, when whitespace is not significant, the oneor more programs can store the program source code in a standardized andsquashed binary format. For program source code in languages whereindentation/whitespace is significant, the one or more programs wouldpreserve this whitespace and would not include it in subsequentautomatic reformatting (when checked out of a repository for furtherediting).

Some embodiments of the present invention may be implemented aslanguage-specific tools to build canonical internal representations(e.g., an Abstract Syntax Tree), that allow the bi-directional mappingsto occur. In these embodiments, for storage purposes, one or moreprograms could naturally serialize the AST into a minimizedrepresentation. Some embodiments of the present invention may utilize alexer to perform lexical analysis (i.e., separating a stream ofcharacters into different words or tokens).

In some embodiments of the present invention, when the one or moreprograms obtain the modified code and translate it into the setstructure, the one or more programs determine whether to preservereferences in the modified program source code in the set structure. Forexample, the one or more programs determine whether references,including but not limited to, line numbers in core dumps or trace files,are specific to the formatting of the source code when it was compiledon the build machine. If the one or more programs determine that thereferences should be preserved, in some embodiments of the presentinvention, the one or more programs can access mapping tables that weregenerated as part of the build to preserve the mappings between the linenumbers and, for example, in the matching AST node. The one or moreprograms could update the entries in the tables to designate thelocations of the references in the set structure. Thus, when the code ischecked out for further editing, the editor could use this table to mapthe line number entries to their re-formatted locations.

The one or more programs identify the at least one change by comparingthe set structure representing the modified program code to the latestversion of the program source code (also in the set structure) in therepository 204 (350). As discussed above, the changes identified in thiscomparison are actual substantive changes to the source code, ratherthan stylistic changes that the individual developer implemented inorder to view and edit the program source code more coherently in theeditor 202.

Based on determining the differences between the versions, the one ormore programs store the set structure representing the program sourcecode in a source management system of the repository 204 (360). The oneor more programs store the identified changes in the repository. Inembodiments of the present invention, the formal contract being that theback-and-forth conversions is both lossless and reproducible.

FIG. 4 is a workflow 400 if an embodiment of the present invention thatalso references the technical environment 200 of FIG. 2 for illustrativepurposes. Referring to FIG. 4, in the event the developer desires tomake additional changes to the modified source code, through the editor,the developer (user) makes a request to check the program source codeout of the repository 204 (410). Based on receiving this request, theone or more programs extract the set structure representing therequested program source code from the repository 204 (420). The one ormore programs identify formatting settings selected by the developer inthe editor 202 (e.g., including custom and default settings) (430). Theone or more programs apply the identified formatting settings to the setstructure, translating the set structure into source program codedisplayed in accordance with the preferences of the developer (450). Forexample, if the one or more programs eliminated indentations in whitespace inserted by the developer when editing the program source codewhen storing the modified code in the repository, the one or moreprograms may insert these elements at this juncture. In an embodiment ofthe present invention, these settings may be default settings in theeditor in addition to or rather than those selected manually by thedeveloper. The one or more programs display the formatted program sourcecode in the editor 202, making it available for editing by the user(460).

Embodiments of the present invention include a computer-implementedmethod, a computer program product, and a computer system where one ormore programs, executing on one or more processors of a host, obtain,from a client, via a communication connection over a network, a requestto commit a modified version of program source code to a repositoryadministered by the host. The one or more programs identify formattingin the modified version implemented by an editor executing on theclient. The one or more programs remove the identified formatting fromthe modified version. The one or more programs transform the modifiedversion into a first storage structure comprising content of themodified version without the identified formatting. The one or moreprograms identify one or more differences between the first storagestructure representing the modified version and a second storagestructure, where the second storage structure comprises an unmodifiedversion of the program source code stored in the repository. The one ormore programs store the one or more differences in the repository.

In some embodiments of the present invention, the unmodified version ofthe program source code includes a last version of the program sourcecode committed to the repository.

In some embodiments of the present invention, to identify theformatting, the one or more programs determine if the formatting in themodified version implemented by an editor executing on the clientincludes one of: custom formatting implemented by user entry in agraphical user interface of the editor or default formatting implementedautomatically in the editor.

In an embodiments of the present invention, the one or more programsalso obtain, from the client, via the communication connection over thenetwork, a request to obtain a most recent version of the program sourcecode from the repository. The one or more programs extract a setstructure representing the most recent version from the repository,where the extracting comprises synthesizing the one or more differencesin the repository and the second storage structure into the setstructure representing the most recent version. The one or more programsidentify selected formatting for program source code displayed in theeditor. The one or more programs convert the most recent version of theprogram source code into a format editable in the editor and applyingthe identified formatting to the most recent version in the formatgenerating a formatted most recent version. The one or more programs mayalso display the formatted most recent version, where the formatted mostrecent version is available in the editor for editing by a user of theclient. In some embodiments of the present invention, the selectedformatting for program source code displayed in the editor is selectedfrom the group consisting of: custom formatting implemented by userentry in the graphical user interface of the editor and defaultformatting implemented automatically in the editor.

In some embodiments of the present invention, the first storagestructure includes a canonical internal representation, and when the oneor more programs transforms the modified version into a first storagestructure, the one or more programs identify a programming languagecomprising the modified version and based on identifying the language,the one or more programs apply a language-specific tool to build thecanonical internal representations.

In some embodiments of the present invention, when the one or moreprograms transform the modified version, the one or more programsidentify one or more references in the modified version. The one or moreprograms also determine whether the one or more references should bepreserved and based on determining that a portion of the one or morereferences should be preserved, the one or more programs access mappingtables generated as part of creating a build of the modified version anddesignating locations of the portion in first storage structure of theone or more references in the mapping tables.

In some embodiments of the present invention, the one or more programsalso obtain from the client, via the communication connection over thenetwork, a request to obtain a most recent version of the program sourcecode from the repository. The one or more programs extract a setstructure representing the most recent version from the repository,where the extracting comprises synthesizing the one or more differencesin the repository and the second storage structure into the setstructure representing the most recent version. The one or more programsidentify selected formatting for program source code displayed in theeditor. The one or more programs convert the most recent version of theprogram source code into a format editable in the editor and apply theidentified formatting to the most recent version in the formatgenerating a formatted most recent version, where the convertingincludes accesses the mapping tables to insert the portion into theformatted most recent version.

In some embodiments of the present invention, the one or more programsdetermine whether the one or more references should be preserved byidentifying a programming language of the modified version.

Referring now to FIG. 5, a schematic of an example of a computing node,which can be a cloud computing node 10. Cloud computing node 10 is onlyone example of a suitable cloud computing node and is not intended tosuggest any limitation as to the scope of use or functionality ofembodiments of the invention described herein. Regardless, cloudcomputing node 10 is capable of being implemented and/or performing anyof the functionality set forth hereinabove. In an embodiment of thepresent invention, the one or more computing resources that compriseserver(s) 203 can be understood as cloud computing node 10 (FIG. 5) andif not a cloud computing node 10, then one or more general computingnode that includes aspects of the cloud computing node 10.

In cloud computing node 10 there is a computer system/server 12, whichis operational with numerous other general purpose or special purposecomputing system environments or configurations. Examples of well-knowncomputing systems, environments, and/or configurations that may besuitable for use with computer system/server 12 include, but are notlimited to, personal computer systems, server computer systems, thinclients, thick clients, handheld or laptop devices, multiprocessorsystems, microprocessor-based systems, set top boxes, programmableconsumer electronics, network PCs, minicomputer systems, mainframecomputer systems, and distributed cloud computing environments thatinclude any of the above systems or devices, and the like.

Computer system/server 12 may be described in the general context ofcomputer system-executable instructions, such as program modules, beingexecuted by a computer system. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system/server 12 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed cloud computing environment, program modules may be locatedin both local and remote computer system storage media including memorystorage devices.

As shown in FIG. 5, computer system/server 12 that can be utilized ascloud computing node 10 is shown in the form of a general-purposecomputing device. The components of computer system/server 12 mayinclude, but are not limited to, one or more processors or processingunits 16, a system memory 28, and a bus 18 that couples various systemcomponents including system memory 28 to processor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnect (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,memory 28 may include at least one program product having a set (e.g.,at least one) of program modules that are configured to carry out thefunctions of embodiments of the invention.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28 by way of example, and not limitation, aswell as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the invention as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system/server 12 cancommunicate with one or more networks such as a local area network(LAN), a general wide area network (WAN), and/or a public network (e.g.,the Internet) via network adapter 20. As depicted, network adapter 20communicates with the other components of computer system/server 12 viabus 18. It should be understood that although not shown, other hardwareand/or software components could be used in conjunction with computersystem/server 12. Examples include, but are not limited to: microcode,device drivers, redundant processing units, external disk drive arrays,RAID systems, tape drives, and data archival storage systems, etc.

It is to be understood that although this disclosure includes a detaileddescription on cloud computing, implementation of the teachings recitedherein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g., networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter). Rapid elasticity:capabilities can be rapidly and elastically provisioned, in some casesautomatically, to quickly scale out and rapidly released to quicklyscale in. To the consumer, the capabilities available for provisioningoften appear to be unlimited and can be purchased in any quantity at anytime.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported, providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure that includes anetwork of interconnected nodes.

Referring now to FIG. 6, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 includes one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 6 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 7, a set of functional abstraction layers providedby cloud computing environment 50 (FIG. 6) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 7 are intended to be illustrative only and embodiments of theinvention are not limited thereto. As depicted, the following layers andcorresponding functions are provided:

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include: mainframes 61; RISC(Reduced Instruction Set Computer) architecture based servers 62;servers 63; blade servers 64; storage devices 65; and networks andnetworking components 66. In some embodiments, software componentsinclude network application server software 67 and database software 68.

Virtualization layer 70 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers71; virtual storage 72; virtual networks 73, including virtual privatenetworks; virtual applications and operating systems 74; and virtualclients 75.

In one example, management layer 80 may provide the functions describedbelow. Resource provisioning 81 provides dynamic procurement ofcomputing resources and other resources that are utilized to performtasks within the cloud computing environment. Metering and Pricing 82provide cost tracking as resources are utilized within the cloudcomputing environment, and billing or invoicing for consumption of theseresources. In one example, these resources may include applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal 83 provides access to the cloud computing environment forconsumers and system administrators. Service level management 84provides cloud computing resource allocation and management such thatrequired service levels are met. Service Level Agreement (SLA) planningand fulfillment 85 provide pre-arrangement for, and procurement of,cloud computing resources for which a future requirement is anticipatedin accordance with an SLA.

Workloads layer 90 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation 91; software development and lifecycle management 92; virtualclassroom education delivery 93; data analytics processing 94;transaction processing 95; and providing lossless bi-directionalformatting of program source code 96.

The present invention may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting. As used herein, thesingular forms “a”, “an” and “the” are intended to include the pluralforms as well, unless the context clearly indicates otherwise. It willbe further understood that the terms “comprises” and/or “comprising”,when used in this specification, specify the presence of statedfeatures, integers, steps, operations, elements, and/or components, butdo not preclude the presence or addition of one or more other features,integers, steps, operations, elements, components and/or groups thereof.

The corresponding structures, materials, acts, and equivalents of allmeans or step plus function elements in the claims below, if any, areintended to include any structure, material, or act for performing thefunction in combination with other claimed elements as specificallyclaimed. The description of one or more embodiments has been presentedfor purposes of illustration and description, but is not intended to beexhaustive or limited to in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the art. Theembodiment was chosen and described in order to best explain variousaspects and the practical application, and to enable others of ordinaryskill in the art to understand various embodiments with variousmodifications as are suited to the particular use contemplated.

What is claimed is:
 1. A computer-implemented method, comprising:obtaining, by one or more processors of a host, from a client, via acommunication connection over a network, a request to commit a modifiedversion of program source code to a repository administered by the host;identifying, by the one or more processors, formatting in the modifiedversion implemented by an editor executing on the client; removing, bythe one or more processors, the identified formatting from the modifiedversion; transforming, by the one or more processors, the modifiedversion into a first storage structure comprising content of themodified version without the identified formatting, wherein the firststorage structure comprises a canonical internal representation;identifying, by the one or more processors, one or more differencesbetween the first storage structure representing the modified versionand a second storage structure, wherein the second storage structurecomprises an unmodified version of the program source code stored in therepository; and storing, by the one or more processors, the one or moredifferences in the repository.
 2. The computer-implemented method ofclaim 1, wherein the unmodified version of the program source codecomprises a last version of the program source code committed to therepository.
 3. The computer-implemented method of claim 1, whereinidentifying the formatting comprises: determining, by the one or moreprocessors, if the formatting in the modified version implemented by aneditor executing on the client comprises one of: custom formattingimplemented by user entry in a graphical user interface of the editor ordefault formatting implemented automatically in the editor.
 4. Thecomputer-implemented method of claim 1, further comprising: obtaining,by the one or more processors, from the client, via the communicationconnection over the network, a request to obtain a most recent versionof the program source code from the repository; extracting, by the oneor more processors, a set structure representing the most recent versionfrom the repository, wherein the extracting comprises synthesizing theone or more differences in the repository and the second storagestructure into the set structure representing the most recent version;identifying, by the one or more processors, selected formatting forprogram source code displayed in the editor; and converting, by the oneor more processors, the most recent version of the program source codeinto a format editable in the editor and applying the identifiedformatting to the most recent version in the format generating aformatted most recent version.
 5. The computer-implemented method ofclaim 4, further comprising: displaying, by the one or more programs,the formatted most recent version, wherein the formatted most recentversion is available in the editor for editing by a user of the client.6. The computer-implemented method of claim 4, wherein the selectedformatting for program source code displayed in the editor is selectedfrom the group consisting of: custom formatting implemented by userentry in the graphical user interface of the editor and defaultformatting implemented automatically in the editor.
 7. Thecomputer-implemented method of claim 1, wherein transforming themodified version into a first storage structure comprises: identifying,by the one or more processors, a programming language comprising themodified version; and based on identifying the language, applying, bythe one or more processors, a language-specific tool to build thecanonical internal representations.
 8. The computer-implemented methodof claim 1, wherein the transforming comprises: identifying, by the oneor more processors, one or more references in the modified version;determining, by the one or more processors, whether the one or morereferences should be preserved; and based on determining that a portionof the one or more references should be preserved, accessing, by the oneor more processors, mapping tables generated as part of creating a buildof the modified version and designating locations of the portion infirst storage structure of the one or more references in the mappingtables.
 9. The computer-implemented method of claim 8, furthercomprising: obtaining, by the one or more processors, from the client,via the communication connection over the network, a request to obtain amost recent version of the program source code from the repository;extracting, by the one or more processors, a set structure representingthe most recent version from the repository, wherein the extractingcomprises synthesizing the one or more differences in the repository andthe second storage structure into the set structure representing themost recent version; identifying, by the one or more processors,selected formatting for program source code displayed in the editor; andconverting, by the one or more processors, the most recent version ofthe program source code into a format editable in the editor andapplying the identified formatting to the most recent version in theformat generating a formatted most recent version, wherein theconverting comprises accesses the mapping tables to insert the portioninto the formatted most recent version.
 10. The computer-implementedmethod of claim 8, determining, by the one or more processors, whetherthe one or more references should be preserved comprises identifying aprogramming language of the modified version.
 11. A computer programproduct comprising: a computer readable storage medium readable by oneor more processors and storing instructions for execution by the one ormore processors for performing a method comprising: obtaining, by theone or more processors of a host, from a client, via a communicationconnection over a network, a request to commit a modified version ofprogram source code to a repository administered by the host;identifying, by the one or more processors, formatting in the modifiedversion implemented by an editor executing on the client; removing, bythe one or more processors, the identified formatting from the modifiedversion; transforming, by the one or more processors, the modifiedversion into a first storage structure comprising content of themodified version without the identified formatting, wherein the firststorage structure comprises a canonical internal representation;identifying, by the one or more processors, one or more differencesbetween the first storage structure representing the modified versionand a second storage structure, wherein the second storage structurecomprises an unmodified version of the program source code stored in therepository; and storing, by the one or more processors, the one or moredifferences in the repository.
 12. The computer program product of claim11, wherein the unmodified version of the program source code comprisesa last version of the program source code committed to the repository.13. The computer program product of claim 11, wherein identifying theformatting comprises: determining, by the one or more processors, if theformatting in the modified version implemented by an editor executing onthe client comprises one of: custom formatting implemented by user entryin a graphical user interface of the editor or default formattingimplemented automatically in the editor.
 14. The computer programproduct of claim 11, the method further comprising: obtaining, by theone or more processors, from the client, via the communicationconnection over the network, a request to obtain a most recent versionof the program source code from the repository; extracting, by the oneor more processors, a set structure representing the most recent versionfrom the repository, wherein the extracting comprises synthesizing theone or more differences in the repository and the second storagestructure into the set structure representing the most recent version;identifying, by the one or more processors, selected formatting forprogram source code displayed in the editor; and converting, by the oneor more processors, the most recent version of the program source codeinto a format editable in the editor and applying the identifiedformatting to the most recent version in the format generating aformatted most recent version.
 15. The computer program product of claim14, the method further comprising: displaying, by the one or moreprograms, the formatted most recent version, wherein the formatted mostrecent version is available in the editor for editing by a user of theclient.
 16. The computer program product of claim 14, wherein theselected formatting for program source code displayed in the editor isselected from the group consisting of: custom formatting implemented byuser entry in the graphical user interface of the editor and defaultformatting implemented automatically in the editor.
 17. The computerprogram product of claim 11, wherein transforming the modified versioninto a first storage structure comprises: identifying, by the one ormore processors, a programming language comprising the modified version;and based on identifying the language, applying, by the one or moreprocessors, a language-specific tool to build the canonical internalrepresentations.
 18. The computer program product of claim 11, whereinthe transforming comprises: identifying, by the one or more processors,one or more references in the modified version; determining, by the oneor more processors, whether the one or more references should bepreserved; and based on determining that a portion of the one or morereferences should be preserved, accessing, by the one or moreprocessors, mapping tables generated as part of creating a build of themodified version and designating locations of the portion in firststorage structure of the one or more references in the mapping tables.19. The computer program product of claim 18, the method furthercomprising: obtaining, by the one or more processors, from the client,via the communication connection over the network, a request to obtain amost recent version of the program source code from the repository;extracting, by the one or more processors, a set structure representingthe most recent version from the repository, wherein the extractingcomprises synthesizing the one or more differences in the repository andthe second storage structure into the set structure representing themost recent version; identifying, by the one or more processors,selected formatting for program source code displayed in the editor; andconverting, by the one or more processors, the most recent version ofthe program source code into a format editable in the editor andapplying the identified formatting to the most recent version in theformat generating a formatted most recent version, wherein theconverting comprises accesses the mapping tables to insert the portioninto the formatted most recent version.
 20. A system comprising: amemory; one or more processors in communication with the memory; andprogram instructions executable by the one or more processors via thememory to perform a method, the method comprising: obtaining, by the oneor more processors of a host, from a client, via a communicationconnection over a network, a request to commit a modified version ofprogram source code to a repository administered by the host;identifying, by the one or more processors, formatting in the modifiedversion implemented by an editor executing on the client; removing, bythe one or more processors, the identified formatting from the modifiedversion; transforming, by the one or more processors, the modifiedversion into a first storage structure comprising content of themodified version without the identified formatting, wherein the firststorage structure comprises a canonical internal representation;identifying, by the one or more processors, one or more differencesbetween the first storage structure representing the modified versionand a second storage structure, wherein the second storage structurecomprises an unmodified version of the program source code stored in therepository; and storing, by the one or more processors, the one or moredifferences in the repository.